import React,{PureComponent} from 'react';
import {Row,Col,Card,Button,Table,Icon,Input ,Select,Collapse,notification,Spin, Alert,Modal,message } from 'antd';
import {createForm} from 'rc-form';
import './index.less';
import ajax from 'utils/ajax';
import { hashHistory } from 'react-router';
import loginVerify from 'utils/loginVerify';
import moment from 'moment';

const { TextArea } = Input;
const Panel = Collapse.Panel;

const operation = [
        {
        title: '操作时间',
        dataIndex: 'operationTime',
        key: 'operationTime',
        },
        {
        title: '操作人',
        dataIndex: 'operationId',
        key: 'operationId',
        },
        {
        title: '操作类型',
        dataIndex: 'operationType',
        key: 'operationType',
        },
        {
        title: '修改前',
        dataIndex: 'modifyBefore',
        key: 'modifyBefore',
        },
        {
        title: '修改后',
        dataIndex: 'modifyAfter',
        key: 'modifyAfter',
        },
    ]
const mailData = [{
  key: '1',
  name: '胡彦斌',
  tel: 32,
  name_two: '西湖区湖底公园1号',
  tel_two:12151,
}, {
  key: '2',
  name: '胡彦斌',
  tel: 32,
  name_two: '西湖区湖底公园1号',
  tel_two:12151,
},{
  key: '3',
  name: '胡彦斌',
  tel: 32,
  name_two: '西湖区湖底公园1号',
  tel_two:12151,
},{
  key: '4',
  name: '胡彦斌',
  tel: 32,
  name_two: '西湖区湖底公园1号',
  tel_two:12151,
},{
  key: '5',
  name: '胡彦斌',
  tel: 32,
  name_two: '西湖区湖底公园1号',
  tel_two:12151,
},{
  key: '6',
  name: '胡彦斌',
  tel: 32,
  name_two: '西湖区湖底公园1号',
  tel_two:12151,
}];

const mail = [{
  title: '姓名',
  dataIndex: 'name',
  key: 'name',
}, {
  title: '手机号码',
  dataIndex: 'tel',
  key: 'tel',
}, {
  title: '姓名',
  dataIndex: 'name_two',
  key: 'name_two',
},, {
  title: '手机号码',
  dataIndex: 'tel_two',
  key: 'tel_two',
}];



const columns = [{
  title: '关系',
  dataIndex: 'relationType',
  key: 'relationType'
}, {
  title: '姓名',
  dataIndex: 'relationName',
  key: 'relationName',
}, {
  title: '手机号码',
  dataIndex: 'relationMobile',
  key: 'relationMobile',
}];
var flag = 0;
var childrenTv2 = [],children=[],childrenOc=[],childrenOh=[],childrenSPC=[],childrenFail=[],childrenSuccess=[];
var lengths=[
                [{title:"A",mode:"免照会"},{title:"B",mode:"申请人手机"},{title:"C",mode:"单位电话"},{title:"D",mode:"百度正常电话"},{title:"E",mode:"联系人1"},{title:"F",mode:"联系人2"},{title:"J",mode:"补充练习人"},{title:"H",mode:"其他"}],
                [{title:"0",mode:"免照会"},{title:"1",mode:"申请人本人"},{title:"2",mode:"电话属主人"},{title:"3",mode:"非本(排除人事/财务)"},{title:"4",mode:"其他查询一致"}],
                [{title:"0",mode:"无需验证"},{title:"1",mode:"无法验证"},{title:"2",mode:"百度正查一致"},{title:"3",mode:"百度反查一致"},{title:"4",mode:"其他查询一致"}],
                [{title:"1",mode:"三方核实"},{title:"2",mode:"父母核实"},{title:"3",mode:"配偶核实"},{title:"4",mode:"兄弟姐妹核实"},{title:"5",mode:"其他亲属核实"},{title:"6",mode:"同事核实"},{title:"7",mode:"朋友核实"},{title:"8",mode:"同学核实"},{title:"9",mode:"其他"}],
                ["001","002",,"003"],
                ["D11","D12","D13","D14","D15","D16","D17","D18","D19","D20","D31","D32","D33","D34","D35","D36","D51","D52","D53","D54","D55","D71","D72","D73","D74","D75","D76","D77","D78","D79","D99","D98","D97","D96"],
                ["A00","A01","A02","A03","A04","A05","A06","A07","A08","A09"]
            ];
 
lengths.map((values,i)=>{
    values.map((value)=>{
        switch (i){
            case 0:
                children.push(<Option key={value.title} value={`${value.title}-${value.mode}`}>{value.title}-{value.mode}</Option>);
                break;
            case 1:
                childrenTv2.push(<Option key={value.title} value={`${value.title}-${value.mode}`}>{value.title}-{value.mode}</Option>);
                break;
            case 2:
                childrenOc.push(<Option key={value.title} value={`${value.title}-${value.mode}`}>{value.title}-{value.mode}</Option>)
                break;
            case 3:
                childrenOh.push(<Option key={value.title} value={`${value.title}-${value.mode}`}>{value.title}-{value.mode}</Option>)
                break;
            case 4:
                childrenSPC.push(<Option key={value} value={`${value}`}>{value}</Option>)
                break;
            case 5:
                childrenFail.push(<Option key={value} value={`${value}`}>{value}</Option>)
                break;
            case 6:
                childrenSuccess.push(<Option key={value} value={`${value}`}>{value}</Option>)
                break;
            default:
                break;
        }
    })
})

class FInformationDetail extends PureComponent{
    state={
        operationData:[],
        customerIdCardInfoVO:{},
        customerBankCardInfoVO:{},
        customerCompanyInfoVO:{},
        customerPeopleRelationshipVO:{},
        payOrderInfoVO:{},
        arr:[],
        isVerity:true,
        riskWarningList:[],
        operationId:"",
        isSpin:true,
        status:0,
        contactRecord:[],
        phoneRecord:[],
        smsRecord:[],
        isStatus:true,
        noteTV1:"",
        noteTV2:"",
        specialNoteOC:"",
        specialNoteOH:"",
        noteRemarks:"",
        personalRemarks:"",
        specialNoteSPC:"",
        reason_one:"",
        reason_two:"",
        reason_three:"",
        specialNoteSPC_one:"",
        specialNoteSPC_two:"",
        specialNoteSPC_three:"",
        personal:true,
        visible:false,
        mainTitle:"",
        isFirst:true,
        riskflag:0,
        isFive:false,
        reasoflag:false,
        cardNo:"",
        content: [],
    }
    componentWillMount(){
        this.setState({
            orderIds:this.props.location.query.orderId,
            status:this.props.location.query.status
        },()=>{
            this.refresh()
        })  
    }
    refresh = ()=>{
        const _this = this,{status,orderIds}=this.state;
        const arr = [...this.state.arr];
        const params = this.props.location.query;
        var isVerity,isStatus,personal,riskWarningList,isFirst=true,isFive,reasoflag=false;
        loginVerify.checkLogin((res)=>{
            _this.setState({
                operationId:res.data.realname,
                userId:res.data.mixId,
            })
        })
        ajax.post({
            url:"/creditaudit/detail",
            data:{orderId:orderIds},
            success(res){
                console.log(123313,res.data.selectSesameResponse.deviceNum)
                var lettertrialConclusion = res.data.selectLetterTrialNoteResponse.lettertrialConclusion
                if(res.data.selectLetterTrialNoteResponse){
                    var lettertrialCauseCode=res.data.selectLetterTrialNoteResponse.lettertrialCauseCode||"",specialNoteSPC=res.data.selectLetterTrialNoteResponse.specialNoteSPC||"";
                }
                if(res.data.selectLetterTrialNoteResponse.riskWarningList){
                    riskWarningList = res.data.selectLetterTrialNoteResponse.riskWarningList
                }else{
                    riskWarningList = []
                }
                if(res.data.selectLetterTrialNoteResponse.lettertrialCauseCode){
                    if(res.data.selectLetterTrialNoteResponse.lettertrialCauseCode !== ""){
                        reasoflag = true;
                    }
                }
                console.log('riskWarningList',riskWarningList)
                if(lettertrialConclusion === '通过'){
                    reasoflag = false;
                }else{
                    reasoflag = true;
                }
                if(JSON.stringify(res.data.selectLetterTrialNoteResponse) !== '{}'){
                    if(res.data.customerPeopleRelationshipVO.length>0){
                        res.data.customerPeopleRelationshipVO.map((data)=>{
                            arr.push({
                                key: `${data.relationMobile}`,
                                relationType: `${data.relationType}`,
                                relationName: `${data.relationName}`,
                                relationMobile: `${data.relationMobile}`,
                            })
                        })
                    }       
                    switch(status){
                        case "1":
                            isFirst=false;
                            isVerity = false;
                            personal=true;
                            break;
                        case "2":
                            isVerity = false;
                            personal = true;
                            break;
                        case "3":
                            isVerity = false;
                            personal = false
                            break;
                        case "4":
                            isVerity = true;
                            personal = true;
                            isStatus = true;
                            isFive = true;
                            break;
                        case "5":
                            isVerity = false;
                            personal = true
                            isStatus = false;
                            isFive = true;
                            break;
                        case "6":
                            isVerity = false;
                            personal = false
                            break;
                        case "7":
                            isVerity = false;
                            personal = false
                            break;
                        default:
                            break;
                    }
                    _this.setState({
                        isFirst,
                        personal,
                        customerIdCardInfoVO:res.data.customerIdCardInfoVO||"",
                        customerBankCardInfoVO:res.data.customerBankCardInfoVO||"",
                        customerCompanyInfoVO:res.data.customerCompanyInfoVO||"",
                        customerPeopleRelationshipVO:res.data.customerPeopleRelationshipVO||"",
                        payOrderInfoVO:res.data.payOrderInfoVO||"",
                        orderUserId:res.data.payOrderInfoVO.userId||"",
                        arr,
                        isFive,
                        reasoflag,
                        isVerity,
                        isStatus,
                        cardNo:res.data.customerBankCardInfoVO.cardNo,
                        deviceNum:res.data.selectSesameResponse.deviceNum||"",
                        sesameCreditScore:res.data.selectSesameResponse.sesameCreditScore||"",
                        contactRecord:res.data.contactRecord||[],
                        phoneRecord:res.data.phoneRecord||[],
                        smsRecord:res.data.smsRecord||[],
                        riskWarningList:riskWarningList,
                        customerId:res.data.selectLetterTrialNoteResponse.customerId||"",
                        lettertrialRemarks:res.data.selectLetterTrialNoteResponse.lettertrialRemarks||"",
                        lettertrialConclusion:res.data.selectLetterTrialNoteResponse.lettertrialConclusion||"",
                        isSpin:false,
                        noteTV1:res.data.selectLetterTrialNoteResponse.noteTV1||"",
                        noteTV2:res.data.selectLetterTrialNoteResponse.noteTV2||"",
                        specialNoteOC:res.data.selectLetterTrialNoteResponse.specialNoteOC||"",
                        specialNoteOH:res.data.selectLetterTrialNoteResponse.specialNoteOH||"",
                        noteRemarks:res.data.selectLetterTrialNoteResponse.noteRemarks||"",
                        personalRemarks:res.data.selectLetterTrialNoteResponse.personalRemarks||"",
                        specialNoteSPC:res.data.selectLetterTrialNoteResponse.specialNoteSPC||"",
                        reason_one: lettertrialCauseCode.slice(0,lettertrialCauseCode.indexOf(','))||"",
                        reason_two: lettertrialCauseCode.slice(lettertrialCauseCode.indexOf(',')+1,lettertrialCauseCode.lastIndexOf(','))||"",
                        reason_three: lettertrialCauseCode.slice(lettertrialCauseCode.lastIndexOf(',')+1,lettertrialCauseCode.length)||"",
                        specialNoteSPC_one: specialNoteSPC.slice(0,specialNoteSPC.indexOf(','))||"",
                        specialNoteSPC_two: specialNoteSPC.slice(specialNoteSPC.indexOf(',')+1,specialNoteSPC.lastIndexOf(','))||"",
                        specialNoteSPC_three: specialNoteSPC.slice(specialNoteSPC.lastIndexOf(',')+1,specialNoteSPC.length)||"",
                    },()=>{    
                        if(status === "4"){
                            _this.props.form.setFieldsValue({
                                noteTV1:res.data.selectLetterTrialNoteResponse.noteTV1||"",
                                noteTV2:res.data.selectLetterTrialNoteResponse.noteTV2||"",
                                specialNoteOC:res.data.selectLetterTrialNoteResponse.specialNoteOC||"",
                                specialNoteOH:res.data.selectLetterTrialNoteResponse.specialNoteOH||"",
                                lettertrialRemarks:res.data.selectLetterTrialNoteResponse.lettertrialRemarks||"",
                                lettertrialConclusion:res.data.selectLetterTrialNoteResponse.lettertrialConclusion||"",
                                noteRemarks:res.data.selectLetterTrialNoteResponse.noteRemarks||"",
                                personalRemarks:res.data.selectLetterTrialNoteResponse.personalRemarks||"",
                                specialNoteSPC:res.data.selectLetterTrialNoteResponse.specialNoteSPC||"",
                                reason_one: lettertrialCauseCode.slice(0,lettertrialCauseCode.indexOf(','))||"",
                                reason_two: lettertrialCauseCode.slice(lettertrialCauseCode.indexOf(',')+1,lettertrialCauseCode.lastIndexOf(','))||"",
                                reason_three: lettertrialCauseCode.slice(lettertrialCauseCode.lastIndexOf(',')+1,lettertrialCauseCode.length)||"",
                                specialNoteSPC_one: specialNoteSPC.slice(0,specialNoteSPC.indexOf(','))||"",
                                specialNoteSPC_two: specialNoteSPC.slice(specialNoteSPC.indexOf(',')+1,specialNoteSPC.lastIndexOf(','))||"",
                                specialNoteSPC_three: specialNoteSPC.slice(specialNoteSPC.lastIndexOf(',')+1,specialNoteSPC.length)||"",
                            })
                        }
                    })
                     
                }
            }
        })
    }
    handleOk = (e) => {
        this.setState({
        visible: false,
        });
    }
    handleChange = ()=>{
        const {orderIds}=this.state;
        const _this= this;
        if(flag){
            flag = 0;
        }else{
            ajax.post({
                url:"/creditaudit/getOperationLog",
                data:{orderId:orderIds},
                success(res){
                    _this.setState({
                        operationData:res.data
                    })
                }
            })
            flag = 1;
        }     
    }
    handleSumbit = (event)=>{
        const {operationId,userId} =this.state;
        var button = "",type="",url="",params="",_this=this,data=null,riskflag=0,message='';
        const arr = [...this.state.riskWarningList];
        console.log('arr',arr)
        const {payOrderInfoVO,customerId,orderUserId} =this.state;
         this.props.form.validateFields({ force: true }, (error) => {
              if (!error) { 
                const obj = this.props.form.getFieldsValue();
            //    if(arr.length !== 0){
            //        if(obj.lettertrialConclusion === '拒绝'){
            //             riskflag=1;
            //         }else if(obj.lettertrialConclusion === '通过'){
            //             arr.map((value)=>{
            //                 if(value.riskWarningState === '未排除'){
            //                     riskflag = 1;
            //                     return false;
            //                 }else{
            //                     riskflag = 0;
            //                 }
            //                 return riskflag;
            //             })
            //         }             
            //    }else{
            //        if(obj.lettertrialConclusion === '拒绝'){
            //             riskflag=1;
            //         }else{
            //             riskflag = 0;
            //         }          
            //    }       
            console.log('arr',arr)
            console.log(obj.lettertrialConclusion)
                if(obj.lettertrialConclusion === '通过'){
                    if(arr.length !== 0){
                        for(var i = 0;i<arr.length;i++){
                            if(arr[i].riskWarningState === '未排除' ){
                                riskflag = 1;
                                message = '风险提示未排除';
                                break;
                            }else{
                                riskflag = 0;
                            }
                        }
                    }
                }else if(obj.lettertrialConclusion === '拒绝'){
                    riskflag = 1;
                    message = '原因码未填写'
                }
               console.log('lettertrialConclusion',obj.lettertrialConclusion,riskflag)
                obj.riskWarningList=arr;
                obj.orderId = payOrderInfoVO.orderNo;
                obj.customerId=customerId;
                obj.operationId=operationId;
                obj.specialNoteSPC = `${this.props.form.getFieldValue('specialNoteSPC_one')},${this.props.form.getFieldValue('specialNoteSPC_two')},${this.props.form.getFieldValue('specialNoteSPC_three')}`
                
                if(riskflag){
                    this.setState({
                        riskflag
                    })
                    obj.lettertrialCauseCode = `${this.props.form.getFieldValue('reason_one')},${this.props.form.getFieldValue('reason_two')},${this.props.form.getFieldValue('reason_three')}`             
                }else{
                    obj.lettertrialCauseCode ="";
                }          
                delete obj.reason_one;
                delete obj.reason_two;
                delete obj.reason_three;
                console.log('obj.lettertrialCauseCode',obj.lettertrialCauseCode)
                for(var i in obj){
                    console.log(obj[i])
                    if(obj[i] === undefined || obj[i] ===null || obj[i].indexOf("undefined")>=0){
                        obj[i]="";
                    }
                }
                 console.log(543626,obj)
                switch(event){
                    case 1 :
                        button = '初审';
                        type = '1';
                        url = '/creditaudit/create'
                        obj.operationStep=button; 
                        obj.customerId=orderUserId;
                        data=JSON.stringify(obj)
                        break;
                    case 2 :
                        button = '暂存';
                        type = '2';
                        url = '/creditaudit/create'
                        obj.operationStep=button; 
                        obj.customerId=orderUserId
                        data=JSON.stringify(obj)
                        break;
                    case 3 :
                        button = '转移';
                        type = '2';
                        url = '/creditaudit/distributionOrder';
                        data=[{"orderId":payOrderInfoVO.orderNo,"auditStatus":1}];
                        break;
                    case 4 :
                        button = '结案';
                        type = '3';
                        url = '/creditaudit/distributionOrder';
                        data=JSON.stringify([{"orderId":payOrderInfoVO.orderNo,"auditStatus":7,"auditConclusion":obj.lettertrialConclusion,userId}]);
                        break;
                    case 5 :
                        button = '回退';
                        type = '3';
                        url = '/creditaudit/create';
                        obj.operationStep=button; 
                        obj.customerId=orderUserId
                        data=JSON.stringify({...obj,"orderId":payOrderInfoVO.orderNo,"auditConclusion":obj.lettertrialConclusion});
                        break;
                    default:
                        break;
                }
                console.log("riskflag",riskflag)
               console.log(1234,this.props.form.getFieldValue('reason_one'))
                if(this.props.form.getFieldValue('noteTV1') !== undefined && this.props.form.getFieldValue('noteTV2')!== undefined&&this.props.form.getFieldValue('specialNoteOC') !== undefined){
                    if(riskflag){  
                        if(this.props.form.getFieldValue('reason_one').length>0 && this.props.form.getFieldValue('reason_one').length>0&&this.props.form.getFieldValue('reason_one') .length>0){
                            ajax.post({
                                url,
                                data:{data,type,operationId},
                                success(){
                                    notification.success({
                                        message: `${button}成功`,
                                        onClose: close,
                                    })
                                    _this.jumpBack();
                                },
                                error(){
                                    notification.error({
                                        message: `${button}失败`,
                                        onClose: close,
                                    })
                                }
                            })
                        }else{
                            message.error(message);
                        }                      
                    }else{
                        ajax.post({
                            url,
                            data:{data,type,operationId},
                            success(){
                                notification.success({
                                    message: `${button}成功`,
                                    onClose: close,
                                })
                                _this.jumpBack();
                            },
                            error(){
                                notification.error({
                                    message: `${button}失败`,
                                    onClose: close,
                                })
                            }
                        })   
                    }
                }     
              }
         })
    }

    jumpBack = () => {
        hashHistory.hashHistory('/cms/manage/InfoAuditManager/loanManager');
    }

    onChange=(value)=>{
        const riskWarningList =[...this.state.riskWarningList];
        if(riskWarningList[value].riskWarningState === '未排除'){
            riskWarningList[value].riskWarningState = '已排除'
        }else{
            riskWarningList[value].riskWarningState = '未排除'
        }
        this.setState({
            riskWarningList
        })
    }
    handleModal = (mainTitle, content)=>{
        let mailData = [];
        let mail = [];
        switch (mainTitle) {
            case '通讯录':
                mailData = content.map((value) => {
                    let obj = {};
                    obj.key = value.userId;
                    obj.name = value.name;
                    obj.phone = value.phone;
                    return obj;
                });
                mail =[{
                        title: '姓名',
                        dataIndex: 'name',
                        key: 'name',
                    },{
                        title: '手机号码',
                        dataIndex: 'tel',
                        key: 'phone',
                    },
                ];
                break;
            case '通话记录':
                mailData = content.map((value) => {
                    let obj = {};
                    obj.key = value.userId;
                    obj.cachedName = value.cachedName;
                    obj.number = value.number;
                    obj.type = value.type;
                    obj.calledDate = value.calledDate;
                    obj.duration = value.duration;
                });
                mail =[{
                        title: '姓名',
                        dataIndex: 'cachedName',
                        key: 'cachedName',
                    },{
                        title: '手机号码',
                        dataIndex: 'number',
                        key: 'number',
                    },{
                        title: '呼入/呼出',
                        dataIndex: 'type',
                        key: 'type',
                        render: (text) => {
                            let showText = '';
                            switch (text) {
                                case 1:
                                    showText = '呼入'
                                    break;
                                case 2:
                                    showText = '呼出'
                                    break;
                                case 3:
                                    showText = '未接'
                                    break;
                                default:
                                    break;
                            }
                            return <span>{showText}</span>;
                        },
                    },{
                        title: '拨打时间',
                        dataIndex: 'calledDate',
                        key: 'calledDate',
                        render: (text, row, index) => {
                        return new Date(text).format("yyyy-MM-dd HH:mm:ss");
                        }
                    },{
                        title: '通话时长',
                        dataIndex: 'duration',
                        key: 'duration',
                        render: (text) => {
                            const s = text % 60;
                            const m = (text - s) / 60;
                            return <span>{m}:{s}</span>;
                        }
                    },
                ];
                break;
            case '短信':
                mailData = content.map((value) => {
                    let obj = {};
                    obj.key = value.userId;
                    obj.address = value.address;
                    obj.type = value.type;
                    obj.sendDate = value.sendDate;
                    obj.content = value.content;
                });
                mail =[
                    // {
                    //     title: '姓名',
                    //     dataIndex: 'cachedName',
                    //     key: 'cachedName',
                    // },
                    {
                        title: '手机号码',
                        dataIndex: 'address',
                        key: 'address',
                    },{
                        title: '接收/发送',
                        dataIndex: 'type',
                        key: 'type',
                        render: (text) => {
                            let showText = '';
                            switch (text) {
                                case 0:
                                    showText = '所有短信';
                                    break;
                                case 1:
                                    showText = '接收';
                                    break;
                                case 2:
                                    showText = '发送';
                                    break;
                                case 3:
                                    showText = '草稿';
                                    break;
                                case 4:
                                    showText = '发件箱';
                                    break;
                                case 5:
                                    showText = '发送失败';
                                    break;
                                case 6:
                                    showText = '待发送列表';
                                    break;
                                default:
                                    break;
                            }
                            return <span>{showText}</span>;
                        },
                    },{
                        title: '收发时间',
                        dataIndex: 'sendDate',
                        key: 'sendDate',
                        render: (text, row, index) => {
                        return new Date(text).format("yyyy-MM-dd HH:mm:ss");
                        }
                    },{
                        title: '短信内容',
                        dataIndex: 'content',
                        key: 'content',
                    },
                ];
                break;
        
            default:
                break;
        }
        this.setState({
            visible:true,
        },()=>{
            this.setState({
                mainTitle,
                content,
                mail,
            })
        })
    }
    ChangeState = value=>{
        if(value.indexOf('通过')>=0){
            this.setState({
                reasoflag:false
            })
        }  
        if(value.indexOf('拒绝')>=0){
            this.setState({
                reasoflag:true
            })
        }
    }
    render(){
        const { getFieldDecorator } = this.props.form;
        const {cardNo,operationData,reasoflag,isFive,riskflag,isFirst,isStatus,mainTitle,personal,noteTV1,noteTV2,specialNoteOC,specialNoteOH,noteRemarks,personalRemarks,specialNoteSPC,reason_one,reason_two,reason_three,specialNoteSPC_one,specialNoteSPC_two,specialNoteSPC_three,isSpin,lettertrialConclusion,lettertrialRemarks,riskWarningList,isVerity,sesameCreditScore,phoneRecord,smsRecord,contactRecord,deviceNum,arr,customerIdCardInfoVO,customerBankCardInfoVO,customerCompanyInfoVO,customerPeopleRelationshipVO,payOrderInfoVO} = this.state;
        let newOldSign = '',borrowType="",unit = "";
        console.log('riskflag',riskflag)
        if(customerIdCardInfoVO.sex === 1){
            customerIdCardInfoVO.sex ='男'
        }else if (customerIdCardInfoVO.sex === 2){
            customerIdCardInfoVO.sex ='女'
        }else{
            customerIdCardInfoVO.sex ='未知'
        }
        if(payOrderInfoVO.newOldSign === '1'){
            newOldSign = '新户'
        }else if(payOrderInfoVO.newOldSign === '2'){
            newOldSign = '旧户'
        }else{
            newOldSign = '次户'
        }
        if(payOrderInfoVO.borrowType === 1){
            borrowType='单期贷'
            unit = '天'
        }else if(payOrderInfoVO.borrowType === 2){
            borrowType = '秒贷'
            unit = '天'
        }else{
            borrowType = '分期贷'
            unit = '期'
        }
        return(
            <div className='infor-detail'>
                <Modal
                    title={mainTitle}
                    visible={this.state.visible}
                    onOk={this.handleOk}
                    onCancel={this.handleOk}
                    >
                    {/* <div className='mail-title'>
                        <div className='key-word'><span style={{float:"left",width:"14%"}}>亲属关键字:</span><p style={{float:"left",width:"86%"}}>赵妈／妈妈／李小妈／薛姨妈／李姐／赵姐／大哥／王哥／小陈／催收王／阿姨／阿越／阿曼</p></div>
                        <div className='key-word'><span style={{float:"left",width:"14%"}}>风险关键字:</span><p style={{float:"left",width:"86%"}}>贷款王／放贷专家／房东／银行小李／</p></div>
                        <div className='key-word'><span style={{float:"left",width:"14%"}}>抓取时间:</span></div>
                    </div> */}
                    <div style={{marginTop:30}}>
                        <Table dataSource={this.state.mailData} columns={this.state.mail} pagination={false} scroll={{ y: 160 }}/>
                    </div>
                </Modal>
                <div className='row'>
                    <div className='col'>
                        <div className='cols'>
                            <div className="header-title">芝麻信用分</div>
                            <div className='point'>{sesameCreditScore}</div>
                        </div>
                        <div className='cols'>
                            <div className="header-title">通讯录</div>
                            <div className='point'>{contactRecord.length}</div>
                        </div>
                        <div className='cols'>
                            <div className="header-title">设备匹配</div>
                            <div className='point'>{deviceNum}</div>
                        </div>
                    </div>
                    <div className='col_two'>
                        <div className='cols'>
                            <span className="header-title">借款金额:&nbsp;{parseInt(payOrderInfoVO.loanAmount,10)/100}元</span><br/>
                            <div className='point_two'>申请日期：{moment(payOrderInfoVO.createdAt).format('YYYY-MM-DD hh:mm:ss')}</div>
                        </div>
                         <div className='cols'>
                            <span className="header-title">借款周期:&nbsp;{payOrderInfoVO.loadDays}{unit}</span><br/>
                            <div className='point_two'>新旧用户: {newOldSign}</div>
                        </div>
                         <div className='cols'>
                            <span className="header-title">借款单号:&nbsp;{payOrderInfoVO.orderNo}</span><br/>
                            <div className='point_two'>借款类别：{borrowType}</div>
                        </div>
                    </div>
                </div>
                <div className='row row_two'>
                    <div className='row-left'>
                        <Card title="客户信息表" bordered={false}>
                            <h4 style={{marginBottom:5}}>个人信息</h4>
                            <div style={{paddingBottom:20,float:"left",width:"100%"}}>
                                <div className='person'>
                                    <div className='person-child'>
                                        姓名:{customerIdCardInfoVO.customerName}
                                    </div>
                                    <div className='person-child'>
                                        身份证号:{customerIdCardInfoVO.idCard}
                                    </div>
                                </div>
                                <div className='person'>
                                    <div className='person-child'>
                                        手机号:{customerBankCardInfoVO.mobileNo}
                                    </div>
                                    <div className='person-child'>
                                        居住地址:{`${customerIdCardInfoVO.liveProvince}${customerIdCardInfoVO.liveCity}${customerIdCardInfoVO.liveCountry}`}
                                    </div>
                                </div>
                                <div className='person'>
                                    <div className='person-child'>
                                        年龄:{customerIdCardInfoVO.age}
                                    </div>
                                    <div className='person-child'>
                                        身份证照片:<Button style={{marginLeft:20}}>点击查看</Button>
                                    </div>
                                </div>
                                <div className='person'>                                  
                                    <div className='person-child'>
                                        婚姻情况:{customerIdCardInfoVO.marriageCondition}
                                    </div>
                                </div>
                            </div>
                            <hr className="hr"/>
                            <h4 style={{marginBottom:5}}>银行卡信息</h4>
                            <div style={{paddingBottom:20,float:"left",width:"100%"}}>
                                <div className='person'>
                                    <div className='person-child'>
                                        所属银行:{customerBankCardInfoVO.cardBankName}
                                    </div>
                                    <div className='person-child'>
                                        卡号:{customerBankCardInfoVO.cardNo}
                                    </div>
                                </div>
                                <div className='person'>
                                    <div className='person-child'>
                                        预留手机号:{customerBankCardInfoVO.mobileNo}
                                    </div>
                                    <div className='person-child'>
                                        银行卡归属地:
                                    </div>
                                </div>
                            </div>
                            <hr className="hr"/>
                            <h4 style={{marginBottom:5}}>工作信息</h4>
                            <div style={{paddingBottom:20,float:"left",width:"100%"}}>
                                <div className='person'>
                                    <div className='person-child'>
                                        单位名称:{customerCompanyInfoVO.companyName}
                                    </div>
                                    <div className='person-child'>
                                        职务级别: {customerCompanyInfoVO.positionType}
                                    </div>
                                </div>
                                <div className='person'>
                                    <div className='person-child'>
                                        单位地址:{customerCompanyInfoVO.companyProvince}{customerCompanyInfoVO.companyCity}{customerCompanyInfoVO.companyCountry}
                                    </div>
                                    <div className='person-child' style={{position: 'relative', overflow:' visible', width: '250px'}}>
                                        单位联系电话:{customerCompanyInfoVO.companyTel}<Button style={{marginLeft:10, position:'absolute', bottom: 0}} onClick={()=>{window.open(`https://www.baidu.com/s?wd=${customerCompanyInfoVO.companyTel}`)}}>百度查询</Button>
                                    </div>
                                </div>
                            </div>
                            <hr className="hr"/>
                            <h4 style={{marginBottom:5}}>人际关系</h4>
                             <div style={{paddingBottom:20,float:"left",width:"100%"}}>
                                <Table columns={columns} dataSource={arr} />
                             </div>
                             <hr className="hr"/>
                            <h4 style={{marginBottom:5}}>手机信息</h4>
                             <div style={{paddingBottom:20,float:"left",width:"100%"}}>
                                   <div className='person'>
                                    <div className='person-child' style={{width:"33.3%"}}>
                                        通讯录:<span className='toast' onClick={()=>this.handleModal('通讯录', contactRecord)}>{contactRecord.length}</span>
                                    </div>
                                    <div className='person-child' style={{width:"33.3%"}}>
                                        通话记录:<span className='toast' onClick={()=>this.handleModal('通话记录', phoneRecord)}>{phoneRecord.length}</span>
                                    </div>
                                    <div className='person-child' style={{width:"33.3%"}}>
                                        短信:<span className='toast' onClick={()=>this.handleModal('短信', smsRecord)}>{smsRecord.length}</span>
                                    </div>
                                </div> 
                             </div>
                        </Card>
                         <Card title="额度信息" style={{paddingBottom:20,marginTop:20}}>
                            <ul>
                                <li className='moneyInfo'>
                                    <div className='money-child'>132</div>
                                    <div className='money-child'>312</div>
                                </li>
                                <li className='moneyInfo'>
                                    <div className='money-child'>132</div>
                                    <div className='money-child'>312</div>
                                </li>
                                <li className='moneyInfo'>
                                    <div className='money-child'>132</div>
                                    <div className='money-child'>312</div>
                                </li>
                                <li className='moneyInfo'>
                                    <div className='money-child'>132</div>
                                    <div className='money-child'>312</div>
                                </li>
                                <li className='moneyInfo'>
                                    <div className='money-child'>132</div>
                                    <div className='money-child'>312</div>
                                </li>
                            </ul>
                        </Card>
                        <Card title="所有借款订单" style={{paddingBottom:20,marginTop:20}}>
                            {/*<Table columns={columns} dataSource={data} />*/}
                        </Card>
                    </div>
                     <div className='row-right'>
                         {isSpin ? 
                         <Spin tip="Loading..." style={{height:1321}}>
                            <Alert
                            message="请稍等"
                            type="info"
                            style={{height:700}}
                            />
                        </Spin>:
                            <div>
                                <Card title="初审注记" style={{paddingBottom:20}}>
                            <h4 style={{marginBottom:5}}>风险提示</h4>
                            <div style={{paddingBottom:20,float:"left",width:"100%",paddingLeft:20}}>
                                {riskWarningList.map((value,i)=>(
                                     <div className='prompt' key={i}>
                                        <div className="prompt-content">{value.riskWarningContent}</div>
                                        {isFirst ? !isVerity ? <a href='javascript:;' className="prompt-title" style={{textDecoration:"none",color:value.riskWarningState === '已排除' ? "blue" : "red"}}>{value.riskWarningState}</a>:<Button style={{color:value.riskWarningState === '已排除' ? "blue" : "red"}} type={value.riskWarningState === '已排除' ? "default" : "danger"} className="prompt-title" onClick={()=>this.onChange(i)}>{value.riskWarningState}</Button> : <div></div>}
                                    </div>
                                ))}
                            </div>
                        {isFirst &&
                        <div>
                            <h4 style={{marginBottom:5}}>照会标记</h4>
                            <div style={{paddingBottom:20,float:"left",width:"100%"}}>
                                <div className='prompt'>
                                    <div className="prompt-content">
                                       <span className='titles isRequired'>TV1：</span>
                                        {isVerity ? {...getFieldDecorator('noteTV1',[{
                                            require:true
                                        }])(<Select
                                            mode="combobox"
                                            style={{ width: 200 }}
                                            >
                                            {children}
                                        </Select>)}:<div>{noteTV1}</div>}
                                    </div>
                                </div>
                                <div className='prompt'>
                                    <div className="prompt-content">
                                        <span className='titles isRequired'>TV2：</span>
                                        {isVerity ? {...getFieldDecorator('noteTV2',[{
                                            require:true
                                        }])(<Select
                                            mode="combobox"
                                            style={{ width: 200 }}
                                            >
                                            {childrenTv2}
                                        </Select> )}: <div>{noteTV2}</div>}
                                    </div>
                                </div>
                                <div className='prompt'>
                                    <div className="prompt-content">
                                        <span className='titles'>照会注记备注：</span>
                                        {/*<TextArea rows={4} ></TextArea>*/}
                                       {isVerity ? {...getFieldDecorator('noteRemarks')(<Input
                                            style={{ width: 200 }}
                                            >
                                        </Input> )}: <div>{noteRemarks}</div>}
                                    </div>
                                </div>
                            </div>   
                            <h4 style={{marginBottom:5}}>专项注记</h4>
                            <div style={{paddingBottom:20,float:"left",width:"100%"}}>
                                <div className='prompt'>
                                    <div className="prompt-content">
                                        <span className='titles isRequired'>OC：</span>
                                        {isVerity ? {...getFieldDecorator('specialNoteOC')(<Select
                                            mode="combobox"
                                            style={{ width: 200 }}
                                            >
                                            {childrenOc}
                                        </Select> )}:<div>{specialNoteOC}</div>}
                                    </div>
                                </div>
                                <div className='prompt'>
                                    <div className="prompt-content">
                                        <span className='titles'>OH：</span>
                                        {isVerity ? {...getFieldDecorator('specialNoteOH')(<Select
                                            mode="combobox"
                                            style={{ width: 200 }}
                                            >
                                            {childrenOh}
                                        </Select>)}:<div>{specialNoteOH}</div>}
                                    </div>
                                </div>
                                <div className='prompt'>
                                    <div className="prompt-content">
                                        <span className='titles'>SPC：</span>
                                        {isVerity ? <div style={{width:200,float:'left'}}>
                                        {getFieldDecorator('specialNoteSPC_one')(<Select
                                            mode="combobox"
                                            style={{ width:"100%",marginBottom:10}}
                                            >
                                            {childrenSPC}
                                        </Select>)}
                                        {getFieldDecorator('specialNoteSPC_two')(<Select
                                            mode="combobox"
                                            style={{ width:"100%",marginBottom:10}}
                                            >
                                            {childrenSPC}
                                        </Select>)}
                                        {getFieldDecorator('specialNoteSPC_three')(<Select
                                            mode="combobox"
                                            style={{ width:"100%" }}
                                            >
                                            {childrenSPC}
                                        </Select>)}
                                        </div>: <div>{specialNoteSPC_one},{specialNoteSPC_two},{specialNoteSPC_three}</div>}
                                    </div>
                                </div>
                            </div>
                            <h4 style={{marginBottom:5}}>信审备注</h4>
                            <div style={{paddingBottom:20,float:"left",width:"100%"}}>
                                <div className='prompt'>
                                    <div className="prompt-content">
                                         <span className='titles'>信审备注：</span>                                  
                                        {isVerity ? {...getFieldDecorator('lettertrialRemarks')(<Input                 
                                            style={{ width: 200 }}
                                            />
                                         )}: <div>{lettertrialRemarks}</div>}
                                    </div> 
                                </div>
                            </div>
                            <h4 style={{marginBottom:5}}>信审结论</h4>
                            <div style={{paddingBottom:20,float:"left",width:"100%"}}>
                                <div className='prompt'>
                                    <div className="prompt-content">
                                        <span className='titles'>信审结论：</span>
                                        {isVerity ? {...getFieldDecorator('lettertrialConclusion')(<Select
                                            mode="combobox"
                                            onChange={this.ChangeState}
                                            style={{ width: 200 }}
                                            >
                                            <Option key={1} value="通过">通过</Option>
                                            <Option key={2} value="拒绝">拒绝</Option>
                                        </Select>)}: <div>{lettertrialConclusion}</div>}
                                    </div>
                                </div>
                                {reasoflag && <div className='prompt'>
                                    <div className="prompt-content">
                                        <span className='titles'>原因码：</span>
                                        {isVerity ? <div style={{width: '345px'}}>
                                        {getFieldDecorator('reason_one',[{
                                            require:riskflag?true:false
                                        }])(<Select
                                            mode="combobox"
                                            style={{ width: 66,marginRight: 20}}
                                            >
                                            {childrenFail}
                                        </Select>)}
                                        {getFieldDecorator('reason_two',[{
                                            require:riskflag?true:false
                                        }])(<Select
                                            mode="combobox"
                                            style={{ width: 66,marginRight: 20 }}
                                            >
                                            {childrenFail}
                                        </Select>)}
                                        {getFieldDecorator('reason_three',[{
                                            require:riskflag?true:false
                                        }])(<Select
                                            mode="combobox"
                                            style={{ width: 66,marginRight: 20 }}
                                            >
                                            {childrenFail}
                                        </Select>)}
                                    </div>:<div>{reason_one},{reason_two},{reason_three}</div>}
                                    </div>
                                </div>}
                            </div>
                            <h4 style={{marginBottom:5}}>个人备注</h4>
                            <div style={{paddingBottom:20,float:"left",width:"100%"}}>
                                 <div className='prompt'>
                                    <div className="prompt-content">
                                        <span className='titles'>个人备注：</span>
                                         {personal ? {...getFieldDecorator('personalRemarks')(<Input
                                            style={{ width: 200 }}
                                            />)}: <div>{personalRemarks}</div>}
                                    </div>
                                </div>
                            </div>
                            {isFive && 
                                <div style={{position:"relative"}}>                    
                                    <div style={{position:"absolute",left:"50%",top:40,transform:"translateX(-50%)"}}>           
                                        {isStatus ? 
                                        <div>
                                            <Button onClick={()=>this.handleSumbit(1)}>提交</Button>
                                            <Button onClick={()=>this.handleSumbit(2)}>暂存</Button>
                                        </div>  :
                                        <div>
                                            <Button onClick={()=>this.handleSumbit(4)}>结案</Button>
                                            <Button onClick={()=>this.handleSumbit(5)}>回退</Button>
                                        </div>                                
                                        }                       
                                    </div>
                                </div>}
                            </div>       
                        }
                        </Card>
                            </div>
                        }
                        {isFirst && <Collapse accordion style={{marginTop:20}} onChange={this.handleChange}>
                            <Panel header={'操作日志'} key="1" >
                                <Table dataSource={operationData} columns={operation}/>
                            </Panel>
                         </Collapse>}
                    </div>
                </div>
            </div>
        )
    }
}

const InformationDetail = createForm()(FInformationDetail)
export default InformationDetail;